//
//  Define.h
//  Xinjuxin
//
//  Created by 廖挺 on 16/5/29.
//  Copyright © 2016年 liaoting. All rights reserved.
//

#ifndef Define_h
#define Define_h

#define APP_BUILD 1 // 0 正式  1 测试

#define HOST_BUSINESS_URL @""

#define HOST_TEST_URL @"http://test.ybaby.com:9000/app"

#define APP_KEY  @"b8dcee2bafc452a2f0d1a83f"

#define APP_SECRET @"fjkadjkajfkljdsaklfjasdkjaie23843784dfjaskfjaskfafjakdjfa"

#define MockuaiVersionCode @"1.0.0" //服务器版本



typedef NS_ENUM(NSUInteger, SomeThingType) { //一些状态的枚举，建议不直接使用int来表示状态
    SomeThingTypeA,
    SomeThingTypeB,
    SomeThingTypeC
};

typedef void(^commontVoidBlock) (void);
typedef void(^commontNSIntegerBlock) (NSInteger num);
typedef void(^commontObjectBlock)(id obj);

#define GUIDE_SCHEME "www.ybaby.com"


#define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width //屏幕宽度

#define SCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height //屏幕高度

#define SYSTEM_VERSION [[UIDevice currentDevice] systemVersion] //设备iOS版本号

#define SYSTEM_VERSION_EQUAL_TO(v)                  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame) //是否为某版本

#define SYSTEM_VERSION_GREATER_THAN(v)              ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending) //是否大于某版本

#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v)  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending) //是否大于或等于某版本

#define SYSTEM_VERSION_LESS_THAN(v)                 ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending) //是否小于某版本

#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v)     ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending) //是否小于等于某版本

#define DEGREES_TO_RADIANS(d) (d * M_PI / 180) //角度转弧度

#define iOS7_OR_LATER SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0") //大于等于7.0的ios版本

#define iOS8_OR_LATER SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0") //大于等于8.0的ios版本

#define getCurentTime [NSString stringWithFormat:@"%ld", (long)[[NSDate date] timeIntervalSince1970]] //获取系统时间戳

#define RGBA(r,g,b,a) [UIColor colorWithRed:r/255.f green:g/255.f blue:b/255.f alpha:a] //32位颜色

#define RGB(r,g,b) [UIColor colorWithRed:r/255.f green:g/255.f blue:b/255.f alpha:1.f] //24位颜色

#define WS(weakSelf)  __weak __typeof(&*self)weakSelf = self; //避免block强循环引用，使用弱引用










#endif /* Define_h */
